-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flag catch rebase #39
base: main
Are you sure you want to change the base?
Conversation
@@ -189,7 +189,7 @@ async function menuLoop(agent: AnoncredAgent) { | |||
break; | |||
} | |||
} catch (error) { | |||
if (error.isTtyError) { | |||
if (error && typeof error === 'object' && 'isTtyError' in error && error.isTtyError) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odpal prettiera bo nie powinno byc pojedycznych '
, tylko same "
(na calym projekcie najlepiej, ale to po review)
@@ -12,6 +12,7 @@ import { | |||
LogLevelDesc, | |||
LoggerProvider, | |||
IAsyncProvider, | |||
safeStringifyException, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning ze nie jest uzywany
@@ -46,6 +46,17 @@ const log = LoggerProvider.getOrCreate({ | |||
level: logLevel, | |||
}); | |||
|
|||
interface ResponseError<T> extends AxiosError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nie baw sie z template jak i tak jest uzywany any pozniej
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Albo ogolnie zrob na any tak jak w dalszych testach
t.ok(out, "error thrown for forbidden endpoint truthy OK"); | ||
t.ok(out.response, "enroll admin response truthy OK"); | ||
} catch (err) { | ||
const e = err as ResponseError<any> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nie da sie zrobic } catch (err: ResponseError<any>) {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope
Catch clause variable type annotation must be 'any' or 'unknown' if specified.ts(1196)
@@ -110,7 +111,7 @@ export class CounterpartyHTLCEndpoint implements IWebServiceEndpoint { | |||
this.log.error(`Crash while serving ${reqTag}`, ex); | |||
res.status(500).json({ | |||
message: "Internal Server Error", | |||
error: ex?.stack || ex?.message, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uzyj handleRestEndpointException
jak w innych endpoint
error: ex?.stack || ex?.message, | ||
}); | ||
if (typeof ex === 'object' && ex !== null) { | ||
if ('message' in ex && typeof ex.message === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mozna uproscic w stylu const msg = ex.message ?? ""
i dalej juz includes na tym stringu
res.status(500); | ||
res.statusMessage = ex.message; | ||
res.json({ error: ex.stack }); | ||
if (typeof ex === 'object' && ex !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jeden if moze byc
error: ex?.stack || ex?.message, | ||
}); | ||
if (typeof ex === 'object' && ex !== null) { | ||
if ('message' in ex && typeof ex.message === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tak samo jak wczezesniej, zrob dla dalszych tak samo
error: ex?.stack || ex?.message, | ||
}); | ||
} else { | ||
if (typeof ex === 'object' && ex !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Zrob jeden if gdzie sie dalej w dalszym kodzie tez
400, | ||
`Endpoint ${fInitialize} without required connectorId: response.status === 400 OK`, | ||
`Endpoint ${fInitialize} waithout required connectorId: response.status === 400 OK`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
literowka
0be22af
to
af39d46
Compare
rebase diff